package utils;

import java.util.Scanner;

public class GetNumber {
    public int getUserInputAsInt(){
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        if(input.isEmpty()){
            return -1;
        }
        try{
            return Integer.parseInt(input);
        }catch(NumberFormatException e){
            return -1;
        }
    }
}
